<?php

require_once('../include/MySugarApplication.php');
require_once("../include/Lead.php");
#session_start();
$app->checkSession('Leads/Form.php', $server_unique_key);

$id = "";
$lead_source = "";
$campaign_id = "";
$lead_source_description = "";
$refered_by = "";
$salutation = "";
$first_name = "";
$last_name = "";
$account_name = "";
$title = "";
$department = "";
$do_not_call = "";
$assigned_user_id = "";
$status = "";
$status_description = "";
$phone_work = "";
$phone_mobile = "";
$phone_home = "";
$phone_other = "";
$phone_fax = "";
$email1 = "";
$primary_address_street = "";
$primary_address_city = "";
$primary_address_state = "";
$primary_address_postalcode = "";
$primary_address_country = "";
$alt_address_street = "";
$alt_address_city = "";
$alt_address_state = "";
$alt_address_postalcode = "";
$alt_address_country = "";
$description = "";
$latitude_c = "";
$longitude_c = "";
$direction_c = "";
$date_modified = "";
$created_by = "";
$deleted = "";


$actionType = isset($_REQUEST['actionType']) ? $_REQUEST['actionType'] : "";

if ($actionType == "UPDATE") {

	$query=' leads.id = "'.$_REQUEST["id"].'"';
	$orderby = '';

	$rows = $component->getRecord($query);
	
	foreach($rows as $record) {
							
		$id = $record["id"];
		$lead_source = $record ["lead_source"];
		$campaign_id = $record ["campaign_id"];
		$lead_source_description = $record ["lead_source_description"];
		$refered_by = $record ["refered_by"];
		$salutation = $record ["salutation"];
		$first_name = $record ["first_name"];
		$last_name = $record ["last_name"];
		$account_name = $record ["account_name"];
		$title = $record ["title"];
		$department = $record ["department"];
		$do_not_call = $record ["do_not_call"];
		$assigned_user_id = $record ["assigned_user_id"];
		$status = $record ["status"];
		$status_description = $record ["status_description"];
		$phone_work = $record ["phone_work"];
		$phone_mobile = $record ["phone_mobile"];
		$phone_home = $record ["phone_home"];
		$phone_other = $record ["phone_other"];
		$phone_fax = $record ["phone_fax"];
		$email1 = $record ["email1"];
		$primary_address_street = $record ["primary_address_street"];
		$primary_address_city = $record ["primary_address_city"];
		$primary_address_state = $record ["primary_address_state"];
		$primary_address_postalcode = $record ["primary_address_postalcode"];
		$primary_address_country = $record ["primary_address_country"];
		$alt_address_street = $record ["alt_address_street"];
		$alt_address_city = $record ["alt_address_city"];
		$alt_address_state = $record ["alt_address_state"];
		$alt_address_postalcode = $record ["alt_address_postalcode"];
		$alt_address_country = $record ["alt_address_country"];
		$description = $record ["description"];
		$latitude_c = $record ["latitude_c"];
		$longitude_c = $record ["longitude_c"];
		$direction_c = $record ["direction_c"];
		$date_modified = $record ["date_modified"];
		$created_by = $record ["created_by"];
		$deleted = $record ["deleted"];

	}
}




?>
<!DOCTYPE HTML SYSTEM "http://www.bitzermobile.com/bitzer/dtd/HTML401-loose-bitzer.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<?php
		if (!$isBitzer) {
        	echo '
			<title>MySugar Leads</title>
			<LINK REL=StyleSheet HREF="',$app->appRoot,'include/style.css" TYPE="text/css" MEDIA=screen>
        <script type="text/javascript" src="',$app->appRoot,'include/niftycube.js"></script>
        <script type="text/javascript">
            window.onload=function(){
				var width = "550px";
				setAppRoot("',$app->appRoot,'");
                Nifty("div#container");
                Nifty("div#content,div#nav","same-height small");
                Nifty("div#header,div#footer","small");
                Nifty("ul.postnav a","transparent");
				setWidth("div#container", width);
				setWidth("div#content", width);
				setWidth("div#footer", width);
            }
        </script>';
        } else {
			echo '<title></title>';
		}
			?>    
    </head>
    <body>
    	<?php
		if (!$isBitzer) {
			echo '
        <div id="container">
            <div id="header">
				<table width="100%">
					<tr>
						<td width="95%"><h1>Leads</h1></td>
						<td align="right" width="5%"><a href="',$app->appRoot,'Logout.php">Logout</a></td>
					</tr>
				</table>
			</div>
            <div id="content">
                <h3>Please enter account info.</h3>';
		}
		?>
                <form name="Leads"
                      data-bitzer-title="Leads"
                      data-bitzer-desc="Leads"
                      data-bitzer-type="COMPONENT"
                      data-bitzer-data-url="<?php echo $app->appRoot ?>Leads/Data.php"
		      data-bitzer-sync-scheme="WEBAPP_SOFT"
                      data-bitzer-pagination="true"
		      data-bitzer-read-only="false"
                      data-bitzer-last-modified="2010-03-26 00:00:00 EST"
                      action="Save.php" method="post"
                      enctype="application/x-www-form-urlencoded">
                    <input type="hidden" name="id" value="<?php echo $id ?>"
                           data-bitzer-primary-key="true"
                           data-bitzer-type="string">
                    <?php 
                    	if ($actionType == "UPDATE" ) {
                    		echo '<input type="hidden" name="actionType" value="UPDATE">';
                    	}
                    ?>
<?php
if (!$isBitzer) {
?>
                    <table class="form" width="100%">
                    	<tr>
                            <th>
                                <div align="left">
                                    Lead Source
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <select data-bitzer-label="Lead Source"
                                        data-bitzer-short-label="Lead"
                                        data-bitzer-type="string"
                                        data-bitzer-help-text="Lead source" 
                                        data-bitzer-display-group-name="Contact"
                                        data-bitzer-display-group-order="1"
                                        data-bitzer-display-group-title="Contact Information"
					
                                        tabindex="1" 
                                        name="lead_source"  >
                                <?php
									foreach ($leadsArray as $key => $label) {
									
										if ($label == $lead_source)
											$selected = "SELECTED";
										else
											$selected = "";
								
										echo '<option value="',$key,'" ',$selected,' >',$label,'</option>';
									}
								?>
                                	
                                </select>
<?php
if (!$isBitzer) {
?>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Campaign
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Campaign"
                                       data-bitzer-short-label="Campaign"
                                       data-bitzer-help-text="Campaign"
                                       data-bitzer-type="string"
                                       type="text" name="campaign_id"
                                       data-bitzer-display-group-name="Contact "
                                       size="50" tabindex="2"
                                       value="<?php echo $campaign_id ?>">
<?php
if (!$isBitzer) {
?>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Lead Source Desc.
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Lead Source Desc."
                                       data-bitzer-short-label="Lead Desc."
                                       data-bitzer-help-text="Lead source description"
                                       data-bitzer-type="string"
                                       type="text" name="lead_source_description"
                                       data-bitzer-display-group-name="Contact"
                                       size="50" tabindex="3"
                                       value="<?php echo $lead_source_description ?>">
<?php
if (!$isBitzer) {
?>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Refered By
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Refered By"
                                       data-bitzer-short-label="Refered"
                                       data-bitzer-help-text="Refered By"
                                       data-bitzer-type="string"
                                       type="text" name="refered_by"
                                       data-bitzer-display-group-name="Contact"
                                       size="50" tabindex="4"
                                       value="<?php echo $refered_by ?>">
<?php
if (!$isBitzer) {
?>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Salutation
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <select data-bitzer-label="Salutation"
                                        data-bitzer-short-label="Sal."
                                        data-bitzer-type="string"
                                        data-bitzer-help-text="Salutation" 
                                        data-bitzer-display-group-name="Contact"
					
                                        tabindex="5"
                                        name="salutation"  >
                                <?php
									foreach ($salutationsArray as $key => $label) {
									
										if ($label == $salutation)
											$selected = "SELECTED";
										else
											$selected = "";
								
										echo '<option value="',$key,'" ',$selected,' >',$label,'</option>';
									}
								?>
                                	
                                </select>
<?php
if (!$isBitzer) {
?>
                            </td>
                        </tr>
                        <tr>
                            <th width="27%">
                                <div align="left">
                                    First Name
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="First Name"
                                       data-bitzer-short-label="First name"
                                       data-bitzer-type="string"
                                       data-bitzer-help-text="First name"
                                       data-bitzer-display-group-name="Contact"
                                       type="text" name="first_name"
                                       size="50" tabindex="6"
					
                                       value="<?php echo $first_name ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Last Name
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Last Name"
                                       data-bitzer-short-label="Last name"
                                       data-bitzer-help-text="Last name"
                                       data-bitzer-type="string"
                                       data-bitzer-display-group-name="Contact"
                                       type="text" name="last_name"
                                       size="50" tabindex="7"
					
                                       value="<?php echo $last_name ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Account Name
                                </div>
                            </th>
                            <td>
<?php
}
?>                            <select data-bitzer-label="Account Name"
                                        data-bitzer-type="string"
                                        data-bitzer-help-text="Account name" 
                                        name="account_name"  
                                        data-bitzer-lookup-component="Accounts"
                                        data-bitzer-lookup-view="accounts-default-view"
					data-bitzer-lookup-display-field="name"
					data-bitzer-lookup-component-key="name"
                                        data-bitzer-short-label="Acct."
                                        data-bitzer-display-group-name="Contact"
					
					tabindex="8">
                                	<option></option>
                                </select>
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Title
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Job Title"
                                       data-bitzer-short-label="Title"
                                       data-bitzer-help-text="Title"
                                       data-bitzer-type="integer"
                                       data-bitzer-display-group-name="Contact"
                                       type="text" name="title"
                                       size="50" tabindex="9"
                                       value="<?php echo $title ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Department
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Department"
                                       data-bitzer-short-label="Dept."
                                       data-bitzer-help-text="Department name"
                                       data-bitzer-type="integer"
                                       data-bitzer-display-group-name="Contact"
                                       type="text" name="department"
                                       size="50" tabindex="10"
                                       value="<?php echo $department ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Assignged To User
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <select data-bitzer-label="Assigend To"
                                	    data-bitzer-short-label="User"
                                        data-bitzer-type="integer"
                                        data-bitzer-help-text="Assigned to user" 
                                        name="assigned_user_id"  
                                        data-bitzer-lookup-component="Users"
                                        data-bitzer-lookup-view="users-default-view"
					data-bitzer-lookup-display-field="user_name"
                                        data-bitzer-display-group-name="Contact"
                                        tabindex="11">
                                	<option></option>
                                </select>
<?php
if (!$isBitzer) {
?>
                            </td>
                        </tr>
                                                <tr>
                            <th>
                                <div align="left">
                                    Status
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <select data-bitzer-label="Status"
                                        data-bitzer-short-label="Status"
                                        data-bitzer-type="string"
                                        data-bitzer-help-text="Lead status" 
                                        data-bitzer-display-group-name="Contact"
                                        name="status" tabindex="12" >
                                <?php
									foreach ($statusArray as $key => $label) {
									
										if ($label == $status)
											$selected = "SELECTED";
										else
											$selected = "";
								
										echo '<option value="',$key,'" ',$selected,' >',$label,'</option>';
									}
								?>
                                	
                                </select>
<?php
if (!$isBitzer) {
?>
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Status Description
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Status Description"
                                       data-bitzer-short-label="Status Desc."
                                       data-bitzer-help-text="Description of status"
                                       data-bitzer-type="integer"
                                       data-bitzer-display-group-name="Contact"
                                       type="text" name="status_description"
                                       size="50" tabindex="13"
                                       value="<?php echo $status_description ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                       <tr>
                            <th>
                                <div align="left">
                                    Work Phone
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Work Phone"
                                	   data-bitzer-short-label="Work"
                                       data-bitzer-help-text="Workf phone of lead contact"
                                       data-bitzer-display-group-name="phone"
                                       data-bitzer-display-group-order="2"
                                       data-bitzer-display-group-title="Phones"
                                       data-bitzer-type="tel"
                                       type="text" name="phone_work"
                                       size="50" tabindex="17"
                                       value="<?php echo $phone_work ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Mobile Phone
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Mobile Phone"
                                	   data-bitzer-short-label="Mobile"
                                       data-bitzer-help-text="Mobile phone of lead contact"
                                       data-bitzer-display-group-name="phone"
                                       data-bitzer-type="cell"
                                       type="text" name="phone_mobile"
                                       size="50" tabindex="16"
                                       value="<?php echo $phone_mobile ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Home Phone
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Home Phone"
                                	   data-bitzer-short-label="Home"
                                       data-bitzer-help-text="home phone of lead contact"
                                       data-bitzer-display-group-name="phone"
                                       data-bitzer-type="tel"
                                       type="text" name="phone_home"
                                       size="50" tabindex="15"
                                       value="<?php echo $phone_home ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Other Phone
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Other Phone"
                                	   data-bitzer-short-label="Other"
                                       data-bitzer-help-text="Other phone of lead contact"
                                       data-bitzer-display-group-name="phone"
                                       data-bitzer-type="tel"
                                       type="text" name="phone_other"
                                       size="50" tabindex="14"
                                       value="<?php echo $phone_other ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Fax
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Fax"
                                       data-bitzer-short-label="Fax"
                                       data-bitzer-help-text="Fax number for account"
                                       data-bitzer-display-group-name="Contact"
                                       data-bitzer-type="fax"
                                       type="text" name="phone_fax"
                                       size="50" tabindex="18"
                                       value="<?php echo $phone_fax ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
						<tr>
                            <th>
                                <div align="left">
                                    Do Not Call
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Do Not Call"
                                	   data-bitzer-short-label="Not Call"
                                       data-bitzer-help-text="Does the contact wish not to be called ?"
                                       data-bitzer-display-group-name="Contact"
                                       data-bitzer-type="boolean"
                                       tabindex="19"
                                       type="checkbox" name="do_not_call"
                                       <?php if ($do_not_call == "1") echo ' CHECKED '; ?>
                                       >
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Email
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Email"
                                       data-bitzer-help-text="Email of account"
                                       data-bitzer-type="email"
                                       data-bitzer-display-group-name="Contact"
                                       type="text" name="email1"
                                       size="50" tabindex="20"
                                       value="<?php echo $email1 ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Street
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Street"
                                	   data-bitzer-short-label="Street"
                                       data-bitzer-help-text="Primary street"
                                       data-bitzer-type="street"
                                       type="text" name="primary_address_street"
                                       data-bitzer-display-group-name="primary"
                                       data-bitzer-display-group-order="3"
                                       data-bitzer-display-group-title="Primary Address"
				       data-bitzer-display-group-type="address"
                                       size="50" tabindex="21"
                                       value="<?php echo $primary_address_street ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    City
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="City"
                                	   data-bitzer-short-label="City"
                                       data-bitzer-help-text="Primary city"
                                       data-bitzer-type="city"
                                       type="text" name="primary_address_city"
                                       data-bitzer-display-group-name="primary"
                                       size="50" tabindex="22"
                                       value="<?php echo $primary_address_city ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    State
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="State"
                                	   data-bitzer-short-label="State"
                                       data-bitzer-help-text="Primary state"
                                       data-bitzer-type="state"
                                       type="text" name="primary_address_state"
                                       data-bitzer-display-group-name="primary"
                                       size="50" tabindex="23"
                                       value="<?php echo $primary_address_state ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
         				<tr>
                            <th>
                                <div align="left">
                                    Post Code
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Postal Code"
                                	   data-bitzer-short-label="Zip"
                                       data-bitzer-help-text="Primary postal code"
                                       data-bitzer-type="postalCode"
                                       type="text" name="primary_address_postalcode"
                                       data-bitzer-display-group-name="primary"
                                       size="50" tabindex="24"
                                       value="<?php echo $primary_address_postalcode ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Country
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Country"
                                	   data-bitzer-short-label="Country"
                                       data-bitzer-help-text="Primary country"
                                       data-bitzer-type="country"
                                       type="text" name="primary_address_country"
                                       data-bitzer-display-group-name="primary"
                                       size="50" tabindex="25"
                                       value="<?php echo $primary_address_country ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Street
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Street"
                                	   data-bitzer-short-label="Street"
                                       data-bitzer-help-text="Other street"
                                       data-bitzer-type="street"
                                       type="text" name="alt_address_street"
                                       data-bitzer-display-group-name="other_address"
                                       data-bitzer-display-group-order="4"
                                       data-bitzer-display-group-title="Other Address"
				       data-bitzer-display-group-type="address"
                                       size="50" tabindex="26"
                                       value="<?php echo $alt_address_street ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    City
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="City"
                                	   data-bitzer-short-label="City"
                                       data-bitzer-help-text="Other city"
                                       data-bitzer-type="city"
                                       type="text" name="alt_address_city"
                                       data-bitzer-display-group-name="other_address"
                                       size="50" tabindex="27"
                                       value="<?php echo $alt_address_city ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    State
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="State"
                                	   data-bitzer-short-label="State"
                                       data-bitzer-help-text="Other state"
                                       data-bitzer-type="state"
                                       type="text" name="alt_address_state"
                                       data-bitzer-display-group-name="other_address"
                                       size="50" tabindex="28"
                                       value="<?php echo $alt_address_state ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
         				<tr>
                            <th>
                                <div align="left">
                                    Post Code
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Postal Code"
                                	   data-bitzer-short-label="Zip"
                                       data-bitzer-help-text="Other postal code"
                                       data-bitzer-type="postalCode"
                                       type="text" name="alt_address_postalcode"
                                       data-bitzer-display-group-name="other_address"
                                       size="50" tabindex="29"
                                       value="<?php echo $alt_address_postalcode ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Country
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Country"
                                	   data-bitzer-short-label="Country"
                                       data-bitzer-help-text="Other country"
                                       data-bitzer-type="country"
                                       type="text" name="alt_address_country"
                                       data-bitzer-display-group-name="other_address"
                                       size="50" tabindex="30"
                                       value="<?php echo $alt_address_country ?>">
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>                      
                        <tr>
                            <th>
                                <div align="left">
                                    Description
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                            	<textarea data-bitzer-label="Description"
                                	   data-bitzer-short-label="Desc."
                                       data-bitzer-help-text="Description for account"
                                       data-bitzer-display-group-name="Description"
                                       data-bitzer-display-group-order="4"
                                       data-bitzer-display-group-title="Description"
                                       rows="5" cols="40" tabindex="31"
									   name="description"><?php echo $description ?></textarea>
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Latitude
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-type="latitude"
                                       data-bitzer-hidden="true"
				       data-bitzer-label="Latitude"
				       data-bitzer-display-group-name="location"
				       data-bitzer-display-group-order="5"
				       data-bitzer-display-group-title="Location"
				       data-bitzer-display-group-type="location+user-capture"
                                       type="hidden" name="latitude_c" value="<?php echo $latitude_c ?>" >
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Longitude
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-type="longitude"
                                       readonly
                                       data-bitzer-hidden="true"
				       data-bitzer-display-group-name="location"
				       data-bitzer-label="Longitude"
                                       type="hidden" name="longitude_c" value="<?php echo $longitude_c ?>" >
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Direction
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-type="direction"
                                       data-bitzer-hidden="true"
                                       readonly
                                       type="text" name="direction_c" value="<?php echo $direction_c ?>" >
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                        <tr>
                            <th>
                                <div align="left">
                                    Last Modified On
                                </div>
                            </th>
                            <td>
<?php
}
?>                            
                                <input data-bitzer-label="Modified On"
                                       data-bitzer-help-text="The record was last modified on this date."
                                       data-bitzer-type="datetime"
                                       readonly
                                       type="text" name="last_modified_on" value="<?php echo $date_modified ?>" >
<?php
if (!$isBitzer) {
?>                                       
                            </td>
                        </tr>
                    </table>

                    <br>
                    <table>
                        <tr><td>
                                <ul class="postnav">
                                    <li><a href="javascript:document.Leads.submit();">Save</a></li>
                                </ul>
                            </td>
                            <td>&nbsp;&nbsp;&nbsp;
                            </td>
                            <td>
                                <ul class="postnav">
                                    <li><a href="Data.php">Cancel</a></li>
                                </ul>
                            </td>
                        </tr>
                    </table>
<?php
}
?>                    
                </form>
<?php
if (!$isBitzer) {
?>
            </div>
            <div id="footer"></div>
        </div>
<?php
}
?>
    </body>
</html>
